

<%@ page import="org.tailor.Comment" %>
<html>
    <head>
        <meta name="layout" content="mainLayout" />
        <g:set var="entityName" value="${message(code: 'comment.label', default: 'Comment')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
       
        <div class="col_middel">
            <h1><g:message code="default.create.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${commentInstance}">
            <div class="errors">
                <g:renderErrors bean="${commentInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="commentID"><g:message code="comment.commentID.label" default="Comment ID" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: commentInstance, field: 'commentID', 'errors')}">
                                    <g:textField name="commentID" value="${fieldValue(bean: commentInstance, field: 'commentID')}" />
                                <br/><br/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="commentDescription"><g:message code="comment.commentDescription.label" default="Comment Description" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: commentInstance, field: 'commentDescription', 'errors')}">
                                    <g:textArea name="commentDescription"   value="${commentInstance?.commentDescription}" />
                                     <br/><br/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="authorEmail"><g:message code="comment.authorEmail.label" default="Author Email" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: commentInstance, field: 'authorEmail', 'errors')}">
                                    <g:textField name="authorEmail" value="${commentInstance?.authorEmail}" />
                                     <br/><br/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="authorUrl"><g:message code="comment.authorUrl.label" default="Author Url" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: commentInstance, field: 'authorUrl', 'errors')}">
                                    <g:textField name="authorUrl" value="${commentInstance?.authorUrl}" />
                                     <br/><br/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="client"><g:message code="comment.client.label" default="Client" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: commentInstance, field: 'client', 'errors')}">
                                    <g:select name="client.id" from="${org.tailor.Client.list()}" optionKey="id" optionValue="clientID"  />
                                     <br/><br/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="commentApproved"><g:message code="comment.commentApproved.label" default="Comment Approved" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: commentInstance, field: 'commentApproved', 'errors')}">
                                    <g:checkBox name="commentApproved" value="${commentInstance?.commentApproved}" />
                                     <br/><br/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="commentDate"><g:message code="comment.commentDate.label" default="Comment Date" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: commentInstance, field: 'commentDate', 'errors')}">
                                    <g:datePicker name="commentDate" precision="day" value="${commentInstance?.commentDate}"  />
                                     <br/><br/>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="region"><g:message code="comment.regionName.label" default="Region Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: commentInstance, field: 'region', 'errors')}">
                                    <g:select name="region.id" from="${org.tailor.Regions.list()}" optionKey="id" optionValue="regionName"  />
                                     <br/><br/>
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button">
                    <g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" />
                    </span>
                </div>
            </g:form>
        </div>
    </body>
</html>
